# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=py3-sphinxcontrib-autoprogram
pkgver=0.1.9
pkgrel=0
pkgdesc="Sphinx extension to document CLI programs"
url="https://github.com/sphinx-contrib/autoprogram"
arch="noarch"
license="BSD-2-Clause"
depends="python3 py3-six py3-sphinx"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/sphinx-contrib/autoprogram/archive/refs/tags/$pkgver.tar.gz
	"
builddir="$srcdir/autoprogram-$pkgver"
options="!check" # no tests

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest discover
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
2f32f4686bdfb6ea6a1696b92577841dbb820992e6108d839eb3d5afd8af8befe4e66700facf1c57044b61f07d71dfc28f55490abe2fb74de82fc5946244fad3  py3-sphinxcontrib-autoprogram-0.1.9.tar.gz
"
